//
//  Model_notificationProblem.m
//  KWNLaywerClient
//
//  Created by 孔六五 on 15/1/28.
//  Copyright (c) 2015年 张明磊. All rights reserved.
//

#import "Model_notificationProblem.h"

@implementation Model_notificationProblem

- (void)getProblemDataWithDic:(NSDictionary *)dic
{
    NSString *content = [dic objectForKey:@"content"];
    NSString *id_ = [dic objectForKey:@"id"];
    NSString *flag = [dic objectForKey:@"flag"];
    NSString *question_area = [dic objectForKey:@"question_area"];
    NSString *question_id = [dic objectForKey:@"question_id"];
    NSString *question_type = [dic objectForKey:@"question_type"];
    NSString *time = [dic objectForKey:@"time"];
    NSString *isunread = [dic objectForKey:@"isunread"];
    NSArray *contentimg = [dic objectForKey:@"contentimg"];
    if(content && ![content isKindOfClass:[NSNull class]]){
        self.string_content = content;
    }
    if(id_ && ![id_ isKindOfClass:[NSNull class]]){
        self.string_id = id_;
    }
    if(flag && ![flag isKindOfClass:[NSNull class]]){
        self.string_flag = flag;
    }
    if(question_area && ![question_area isKindOfClass:[NSNull class]]){
        self.string_question_area = question_area;
    }
    if(question_id && ![question_id isKindOfClass:[NSNull class]]){
        self.string_question_id = question_id;
    }
    if(question_type && ![question_type isKindOfClass:[NSNull class]]){
        self.string_question_type = question_type;
    }
    if(time && ![time isKindOfClass:[NSNull class]]){
        self.string_time = time;
    }
    if(contentimg && ![contentimg isKindOfClass:[NSNull class]]){
        self.arr_contentimg = contentimg;
    }
    if(isunread && ![isunread isKindOfClass:[NSNull class]]){
        self.string_isunread = isunread;
    }

    CGFloat height = 0;
    height = 10 + 20 + 10 + 15 + 10;
    if (self.string_content && self.string_content.length>0) {
        height = height + 20 + 10;
    }
    if (self.arr_contentimg && self.arr_contentimg.count >0) {
        height = height + 50 + 10;
    }
    self.pheight = height;
}

@end

@implementation Model_notificationProblemComments

- (void)getProblemCommentsDataWithDic:(NSDictionary *)dic
{
    NSString *content = [dic objectForKey:@"content"];
    NSString *flag = [dic objectForKey:@"flag"];
    NSString *question_area = [dic objectForKey:@"question_area"];
    NSString *question_id = [dic objectForKey:@"question_id"];
    NSString *question_type = [dic objectForKey:@"question_type"];
    NSString *time = [dic objectForKey:@"time"];
    NSString *id_ = [dic objectForKey:@"id"];
    NSString *xy_fraction = [dic objectForKey:@"xy_fraction"];
    NSString *fw_fraction = [dic objectForKey:@"fw_fraction"];
    NSString *zy_fraction = [dic objectForKey:@"zy_fraction"];
    NSString *isunread = [dic objectForKey:@"isunread"];

    if(content && ![content isKindOfClass:[NSNull class]]){
        self.string_content = content;
    }
    if(flag && ![flag isKindOfClass:[NSNull class]]){
        self.string_flag = flag;
    }
    if(question_area && ![question_area isKindOfClass:[NSNull class]]){
        self.string_question_area = question_area;
    }
    if(question_id && ![question_id isKindOfClass:[NSNull class]]){
        self.string_question_id = question_id;
    }
    if(question_type && ![question_type isKindOfClass:[NSNull class]]){
        self.string_question_type = question_type;
    }
    if(time && ![time isKindOfClass:[NSNull class]]){
        self.string_time = time;
    }
    if(id_ && ![id_ isKindOfClass:[NSNull class]]){
        self.string_id = id_;
    }
    if(xy_fraction && ![xy_fraction isKindOfClass:[NSNull class]]){
        self.string_xy_fraction = xy_fraction;
    }
    if(fw_fraction && ![fw_fraction isKindOfClass:[NSNull class]]){
        self.string_fw_fraction = fw_fraction;
    }
    if(zy_fraction && ![zy_fraction isKindOfClass:[NSNull class]]){
        self.string_zy_fraction = zy_fraction;
    }
    if(isunread && ![isunread isKindOfClass:[NSNull class]]){
        self.string_isunread = isunread;
    }

    CGFloat height = 0;
    height = 10 + 20 + 10 + 60 + 10 + 15 + 10;
    if (self.string_content && self.string_content.length>0) {
        height = height + 20 + 10;
    }
    self.pCheight = height;
}

@end
